import request from '@/utils/request'

// 获取列表
export function listCoupon(query) {
  return request({
    url: '/admin/coupons',
    method: 'get',
    params: query
  })
}

// 新增
export function addCoupon(data) {
  return request({
    url: '/admin/coupons',
    method: 'post',
    data: data
  })
}

// 修改
export function updateCoupon(data) {
  return request({
    url: `/admin/coupons/${data.uuid}`,
    method: 'put',
    data: data
  })
}

// 删除
export function delCoupon(uuid) {
  return request({
    url: `/admin/coupons/${uuid}`,
    method: 'delete'
  })
}

// 详情
export function getCoupon(uuid) {
  return request({
    url: `/admin/coupons/${uuid}`,
    method: 'get'
  })
}
